package com.dicti.Util;

import com.alibaba.fastjson.JSONArray;
import com.dicti.domain.Dicti;
import com.dicti.service.DictiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/5/1 23:02
 * @since JDK 1.8
 */
@Component
public class DictiUtils {

    private static DictiService dictiService;

    @Autowired
    public void setUserService(DictiService dictiService) {
        DictiUtils.dictiService = dictiService;
    }

    /**
     * 通过id获取值列表
     * @param id
     * @return
     */
    public static JSONArray getValuesById(String id){
        Dicti dicti=dictiService.getById(id);
        return dicti.getDictiValues();
    }


}
